Skip to content

Latest commit

 

History

History
125 lines (90 loc) · 3.37 KB

How To Check Installed Linux Kernels.org

File metadata and controls

125 lines (90 loc) · 3.37 KB

如何查看已安装的Linux Kernels

想知道你的Linux上安装了那些Linux Kernel? 这篇简易指南将会告诉你在不同Linux操作系统上查看已安装Linux Kernel的方法. 方法其实没有你想象的那么复杂. 请往下看.

Check installed Linux Kernels

On Arch Linux:

在 Arch Linux 及其派生版本中,使用下面命令查找已安装的Kernel:

$ pacman -Q linux

或者

$ pacman -Q | grep linux

输出为:

archlinux-keyring 20171013-1
lib32-util-linux 2.30.1-1
libutil-linux 2.30.2-1
linux 4.13.8-1
linux-api-headers 4.12.7-1
linux-firmware 20170907.a61ac5c-1
syslinux 6.03-7
util-linux 2.30.2-1

http://www.ostechnix.com/wp-content/uploads/2016/03/Check-Installed-Linux-Kernels.png

从上面输出可以看出, 我的 Arch Linux 运行内核为 4.13.8-1.

On RHEL / CentOS / Scientific Linux / Fedora:

打开终端, 运行下面命令来查看已安装的 Linux Kernels:

# rpm -qa kernel

或者

# rpm -qa | grep -i kernel

输出为:

kernel-tools-libs-3.10.0-123.9.3.el7.x86_64
kernel-3.10.0-123.9.3.el7.x86_64
kernel-3.10.0-123.el7.x86_64
kernel-tools-3.10.0-123.9.3.el7.x86_64
kernel-ml-4.4.5-1.el7.elrepo.x86_64

On Debian / Ubuntu / Linux Mint:

在 Debian, Ubuntu, Linux Mint, Elementary OS 等基于 DEB 的系统中查看已安装的Linux Kernels,在终端中运行下面命令:

$ dpkg --list | grep linux-image

输出为:

rc linux-image-4.2.0-16-generic 4.2.0-16.19 amd64 Linux kernel image for version 4.2.0 on 64 bit x86 SMP
ii linux-image-4.2.0-30-generic 4.2.0-30.35 amd64 Linux kernel image for version 4.2.0 on 64 bit x86 SMP
ii linux-image-4.4.0-7-generic 4.4.0-7.22 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.5.0-040500-generic 4.5.0-040500.201603140130 amd64 Linux kernel image for version 4.5.0 on 64 bit x86 SMP
rc linux-image-extra-4.2.0-16-generic 4.2.0-16.19 amd64 Linux kernel extra modules for version 4.2.0 on 64 bit x86 SMP
ii linux-image-extra-4.2.0-30-generic 4.2.0-30.35 amd64 Linux kernel extra modules for version 4.2.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-7-generic 4.4.0-7.22 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-generic 4.4.0.7.8 amd64 Generic Linux kernel image

On SUSE / openSUSE:

在SUSE 和 openSUSE 上, 运行命令:

# rpm -qa | grep -i kernel

输出:

kernel-firmware-20160112git-120.1.noarch
kernel-default-4.1.15-8.1.x86_64
kernel-default-devel-4.5.0-1.1.g3c4edc5.x86_64
kernel-devel-4.5.0-1.1.g3c4edc5.noarch
kernel-default-4.5.0-1.1.g3c4edc5.x86_64
kernel-macros-4.5.0-1.1.g3c4edc5.noarch

就这些了. 你已经知道怎么找出Linux系统中已安装的那些Kernel了.

想查看当前正在运行的Kernel,则运行:

$ uname -r
4.13.8-1-ARCH

或者

$ uname -mrs
Linux 4.13.8-1-ARCH x86_64